package com.one.group.result;



import com.one.group.enums.ErrorCode;
import lombok.Data;

/**
 * {@code @Create:}  2025-09-28  12 : 32
 * {@code @Author:} Cherry
 * {@code @ToUser:} 凡是发生,皆有利于我。
 * ------------------------------------
 * {@code @note:}
 */

@SuppressWarnings({"all"})
@Data
public class Result<T> {
    private Integer code;
    private T data;
    private String message;

    public Result(Integer code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public Result(Integer code, T data) {
        this.code = code;
        this.data = data;
        this.message = "";
    }

    public Result(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.data = null;
        this.message = errorCode.getMessage();
    }
}

